package cn.hchaojie.javase.day11;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;

public class Lucky {
	@Test
	public void test() {
		List<Integer> numbers = new ArrayList<>();
		
		for (int i = 1; i <= 10; i++) {
			numbers.add(i);
		}
		
		while (numbers.size() > 0) {
			int index = (int) (Math.random() * numbers.size());
			Integer removed = numbers.remove(index);
			
			System.out.println(removed);
		}
		
		// 1, 2, 3, ..., 10 => list   => 3  => 1, 2, 4, ..., 10
		
		// 
	}
}
